﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace BaseAPI.BaseViewModel;

public class PageRequest
{
    /// <summary>
    /// 页码，从1开始
    /// <example>1</example>
    /// </summary>
    [Range(1, int.MaxValue, ErrorMessage = "页码为正整数，且大于等于1")]
    [DefaultValue(1)]
    public int PageIndex { get; set; }
    /// <summary>
    /// 每页多少条数据，为0时不分页
    /// <example>0</example>
    /// </summary>
    [Range(0, int.MaxValue, ErrorMessage = "每页数据量为正整数")]
    [DefaultValue(0)]
    public int PageSize { get; set; }
}